home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / ue312h.zip / ESTRUCT.H < prev    next >
C/C++ Source or Header  |  1993-04-22  |  36KB  |  1,131 lines

  1. /*    ESTRUCT:    Structure and preprocesser defined for
  2.             MicroEMACS 3.12
  3.  
  4.             (C)Copyright 1993 by Daniel Lawrence
  5.             written by Daniel Lawrence
  6.             based on code by Dave G. Conroy,
  7.                 Steve Wilhite and George Jones
  8. */
  9.  
  10. #ifdef    LATTICE
  11. #undef    LATTICE      /* don't use their definitions...use ours     */
  12. #endif
  13. #ifdef    MSDOS
  14. #undef    MSDOS
  15. #endif
  16. #ifdef    WINNT
  17. #undef    WINNT
  18. #endif
  19. #ifdef    AMIGA
  20. #undef    AMIGA
  21. #endif
  22. #ifdef    EGA
  23. #undef    EGA
  24. #endif
  25. #ifdef    CTRLZ
  26. #undef    CTRLZ
  27. #endif
  28.  
  29. /*    Program Identification.....
  30.  
  31.     PROGNAME should always be MicroEMACS for a distribution
  32.     unmodified version. People using MicroEMACS as a shell
  33.     for other products should change this to reflect their
  34.     product. Macros can query this via the $progname variable
  35. */
  36.  
  37. #define PROGNAME    "MicroEMACS"
  38. #define VERSION     "3.12"
  39.  
  40. /*    Machine/OS definitions            */
  41. /*    [Set one of these!!]            */
  42.  
  43. #define AMIGA    0            /* AmigaDOS            */
  44. #define AOSVS    0            /* Data General AOS/VS        */
  45. #define AUX     0                       /* Apple UNIX for Macintosh     */
  46. #define AVIION    0            /* Data General AViiON        */
  47. #define BSD    0            /* UNIX BSD 4.2 and ULTRIX    */
  48. #define FINDER    0            /* Macintosh OS         */
  49. #define HPUX8    0            /* HPUX HP 9000 ver 8 or less    */
  50. #define HPUX9    0            /* HPUX HP 9000 ver 9           */
  51. #define MPE    0            /* HP MPE/XL            */
  52. #define MSDOS    0            /* MS-DOS            */
  53. #define WINNT    0            /* MS-Win NT            */
  54. #define OS2    0            /* Microsoft or IBM OS/2    */
  55. #define SMOS    0            /* Supermax UNIX System V    */
  56. #define SUN    0            /* SUN v4.0            */
  57. #define TOS    0            /* ST520, TOS            */
  58. #define USG    0            /* UNIX system V        */
  59. #define V7    0            /* V7 UNIX or Coherent or BSD4.2*/ 
  60. #define VMS    0            /* VAX/VMS            */
  61. #define WMCS    0            /* Wicat's MCS            */
  62. #define XENIX    0            /* IBM-PC SCO XENIX        */
  63.  
  64. /*    Compiler definitions            */
  65. /*    [Set one of these!!]            */
  66. #define ALCYON    0    /* ALCYON Atari ST compiler */ 
  67. #define AZTEC    0    /* Aztec C 3.20e */
  68. #define DGC    0    /* Data General AOS/VS C... */
  69. #define DTL    0    /* DataLight C v3.12 */
  70. #define GCC    0    /* the GNU C compiler */
  71. #define IC    0    /* Rational Systems Instant C */
  72. #define LATTICE 0    /* Lattice 2.14 through 3.0 compilers */
  73. #define MSC    0    /* MicroSoft C compile version 3 thru 7 */
  74. #define MWC    0    /* Mark Williams C */
  75. #define TURBO    0    /* Turbo C and Borland C++ under MSDOS */
  76. #define UNIX    0    /* a standard UNIX compiler (cc) */
  77. #define ZTC    0    /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */
  78.  
  79. /*    Machine stack growth direction.             */
  80. /*  [Set this to 1 if your machine stack grows UP!!!]        */
  81. /*    data general mv/eclipse series stack grows up.        */
  82. /*    dec vax series stack grows down... got it???        */
  83.  
  84. #define STACK_GROWS_UP    0
  85.  
  86. /*    Rational Systems, Inc DOS/16M dos extender allows MicroEMACS
  87.     to run in Protected Mode under MSDOS. It has a few special
  88.     requirements.                            */
  89.  
  90. #define    DOS16M    0
  91.  
  92. /*    Debugging options    */
  93. #define RAMSIZE 0    /* dynamic RAM memory usage tracking */
  94. #define RAMSHOW 0    /* auto dynamic RAM reporting */
  95. #define RAMTRCK 0    /* send debug info to MALLOC.DAT */
  96.  
  97. /*   Special keyboard/network definitions         */
  98.  
  99. #define ATKBD    0        /* AT-style keyboard with F11, F12 & grey keys */
  100. #define WANGPC    0        /* WangPC - mostly escape sequences    */
  101. #define VT100    0        /* Handle VT100 style keypad - NOT VMS. */
  102. #define KEYPAD    0        /* VMS - turn on and off application    */
  103.                 /* keypad automatically */
  104. #define XONDATA 0        /* VMS - set to force /NOTTSYNC/NOHOSTSY */
  105. #define RMSIO    0        /* VMS - skip the rotten C runtime and    */
  106.                 /* use RMS directly            */
  107. #define OPTMEM    0        /* VMS 5.0 and up - use a less standard */
  108.                 /* but more efficient memory allocator    */
  109.  
  110. /*    Terminal Output definitions        */
  111. /*    [Set one of these!!]            */
  112.  
  113. #define ANSI    0            /* ANSI escape sequences    */
  114. #define DASHER    0            /* DG Dasher 2xx/4xx crts    */
  115. #define DG10    0            /* Data General system/10    */
  116. #define FMR    0            /* Fujitsu FMR series driver    */
  117. #define HP110    0            /* HP110 screen driver        */
  118. #define HP150    0            /* HP150 screen driver        */
  119. #define I55    0            /* IBM PS55 DOS J4.0/V        */
  120. #define IBMPC    0            /* IBM-PC CGA/MONO/EGA/VGA drvr */
  121. #define MAC    0            /* Macintosh            */
  122. #define NEC    0            /* NEC-9801VM driver        */
  123. #define OS2NPM    0            /* OS/2 non-Presentation Mgr.    */
  124. #define SMG    0            /* SMG library on VMS        */
  125. #define ST52    0            /* Atari 520/1040ST screen    */
  126. #define TERMCAP 0            /* Use TERMCAP            */
  127. #define TIPC    0            /* TI Profesional PC driver    */
  128. #define VT52    0            /* VT52 terminal (Zenith).    */
  129. #define Z309    0            /* Zenith 100 PC family driver    */
  130. #define WINNTCON 0            /* Windows NT console        */
  131.  
  132. /*    Windowing system style (pick one)                */
  133.  
  134. #define WINDOW_TEXT    1        /* [default] Text mode        */
  135. #define WINDOW_XVT    0        /* using XVT/any platform    */
  136. #define WINDOW_MSWIN    0        /* MicroSoft Windows        */
  137. #define WINDOW_MSWIN32    0        /* MicroSoft Windows 32 bit API */
  138. #define WINDOW_X    0        /* X/Unix            */
  139.  
  140. /*    Language text options    (pick one)                */
  141.  
  142. #define ENGLISH 1        /* [default] */
  143. #define FRENCH    0
  144. #define SPANISH 0
  145. #define GERMAN    0
  146. #define DUTCH    0
  147. #define PLATIN    0        /* Pig Latin */
  148. #define JAPAN    0
  149. #define LATIN    0        /* real Latin */
  150.  
  151. /*    Configuration options    */
  152.  
  153. #define TYPEAH    1    /* type ahead causes update to be skipped    */
  154. #define DEBUGM    1    /* $debug triggers macro debugging        */
  155. #define LOGFLG    0    /* send all executed commands to EMACS.LOG    */
  156. #define VISMAC    0    /* update display during keyboard macros    */
  157. #define CTRLZ    0    /* add a ^Z at end of files under MSDOS only    */
  158. #define CLEAN    0    /* de-alloc memory on exit            */
  159. #define CALLED    0    /* is emacs a called subroutine? or stand alone */
  160.  
  161. #define REVSTA    1    /* Status line appears in reverse video     */
  162. #define COLOR    1    /* color commands and windows            */
  163.  
  164. #define FILOCK    1    /* file locking under unix BSD 4.2        */
  165. #define ISRCH    1    /* Incremental searches like ITS EMACS        */
  166. #define FLABEL    0    /* function key label code [HP150]        */
  167. #define CRYPT    1    /* file encryption enabled?            */
  168. #define MAGIC    1    /* include regular expression matching?     */
  169. #define MOUSE    1    /* Include routines for mouse actions        */
  170. #define NOISY    1    /* Use a fancy BELL if it exists        */
  171. #define CTAGS    0    /* include vi-like tagging?            */
  172. #define SPEECH    0    /* spoken EMACS, for the sight impared [not ready] */
  173. #define VARARG    1    /* use varargs.h for mlwrite()            */
  174.  
  175. /*    Character set options        */
  176. /*    [Set one of these!!]        */
  177. #define ASCII    1    /* always using ASCII char sequences for now    */
  178. #define EBCDIC    0    /* later IBM mainfraim versions will use EBCDIC */
  179.  
  180. /* handle constant and voids properly */
  181.  
  182. #if    VMS
  183. #define CONST    readonly
  184. #define VOID    void
  185. #define NOSHARE noshare
  186. #else
  187. #if    AOSVS
  188. #define CONST $shared $align(1)     /* fake a  const */
  189. #define VOID
  190. #define NOSHARE $low32k $align(1)   /* attempt to optimize read/write vars. */
  191. #else
  192. #if    __STDC__ || MSC || TURBO || DTL || GCC
  193. #define CONST    const
  194. #define VOID    void
  195. #define NOSHARE
  196. #else
  197. #define CONST
  198. #define VOID
  199. #define NOSHARE
  200. #endif
  201. #endif
  202. #endif
  203.  
  204. /*    System dependant library redefinitions, structures and includes */
  205.  
  206. /*    multibyte character support?    */
  207.  
  208. #if    NEC || FMR || I55
  209. #define DBCS    1    /* double byte character sets enabled */
  210. #define INSDEL    1    /* use insert/delete line display optimizations */
  211.  
  212. /* define DBCS prefix bytes */
  213. #define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc))
  214.  
  215. #else
  216. #define DBCS    0
  217. #define INSDEL    0
  218. #endif
  219.  
  220. /*    Prototypes in use?    */
  221.  
  222. #if    MSC || TURBO || IC || DTL || VMS || GCC || ZTC
  223. #define PROTO    1
  224. #else
  225. #define PROTO    0
  226. #endif
  227.  
  228. /*    the following define allows me to initialize unions...
  229.     otherwise we make them structures (like the keybinding table)  */
  230.  
  231. #if    __STDC__ || MSC || TURBO || IC || DTL || ZTC
  232. #define ETYPE    union
  233. #else
  234. #define ETYPE    struct
  235. #endif
  236.  
  237. /* Instant C can't do stat()s. Arrrg. No file locking for you */
  238. #if    IC && MSDOS
  239. #undef FILOCK
  240. #define FILOCK    0
  241. #endif
  242.  
  243. /* Mark Williams/Atari has no standard or varargs or directory functions */
  244. #if    TOS & MWC
  245. #undef VARARG
  246. #define    VARARG    0
  247. #undef    FILOCK
  248. #define    FILOCK    0
  249. #endif
  250.  
  251. /* MS-Windows */
  252.  
  253. #if     WINNT || WINDOW_MSWIN || WINDOW_MSWIN32
  254. #if     WINDOW_MSWIN32
  255. #undef  WINDOW_MSWIN
  256. #define WINDOW_MSWIN    1
  257. #endif
  258. #if     WINDOW_MSWIN && WINNT
  259. #undef  WINDOW_MSWIN32
  260. #define WINDOW_MSWIN32  1
  261. #endif
  262. #undef  VOID    /* windows.h will wind up defining this */
  263. #include <windows.h>    /* --------- Huge include file here !!! ---------*/
  264. #if     WINNTCON
  265. #include <wincon.h>
  266. #include <stdio.h>
  267. #include <dos.h>
  268. #endif
  269.  
  270. #undef NEAR
  271. #define NEAR
  272. #define DNEAR
  273. #if     MSC || IC
  274. #undef CDECL
  275. #define CDECL   __cdecl
  276. #define DUMMYSZ 1    /* dummy size for unsized extern arrays to avoid
  277.                         silly DGROUP fixup */
  278. #else
  279. #if    TURBO
  280. #define DUMMYSZ     /* nothing */
  281. #else
  282. #define CDECL   _cdecl  /* ZTC */
  283. #define DUMMYSZ     /* nothing */
  284. #endif
  285. #endif
  286.  
  287. #if    WINNT
  288. #define    EXPORT    /* Windows NT doesn't like this */
  289. #endif
  290.  
  291. #if     WINDOW_MSWIN
  292. #undef  TYPEAH
  293. #define TYPEAH  0   /* typeahead is handled at the term driver level */
  294. #undef  CALLED
  295. #define CALLED  1   /* under MS Windows, "main" resides in the sys driver */
  296. #if     MSC
  297. #define EXPORT  __export
  298. #else
  299. #define EXPORT  _export    /* Fine for TURBO and ZTC */
  300. #endif
  301. #endif
  302. #else
  303.  
  304. /* neither Windows NT nor MS-Windows */
  305.  
  306. #define DUMMYSZ     /* nothing */
  307.  
  308. #if MSDOS & (TURBO | MSC | TIPC)
  309. #define    NEAR
  310. #define    DNEAR
  311. #define    PASCAL pascal
  312. #define    CDECL cdecl
  313. #else
  314. #if MSDOS & ZTC
  315. #define    NEAR
  316. #define    DNEAR
  317. #define    PASCAL _pascal
  318. #define    CDECL _cdecl
  319. #else
  320. #define NEAR
  321. #define    DNEAR
  322. #define    PASCAL
  323. #define    CDECL
  324. #endif
  325. #endif
  326.  
  327. #endif
  328.  
  329. #if    TURBO
  330. #include      <dos.h>
  331. #include      <mem.h>
  332. #undef peek
  333. #undef poke
  334. #define       peek(a,b,c,d)   movedata(a,b,FP_SEG(c),FP_OFF(c),d)
  335. #define       poke(a,b,c,d)   movedata(FP_SEG(c),FP_OFF(c),a,b,d)
  336. #endif
  337.  
  338. #if    IC
  339. #include      <dos.h>
  340. #undef peek
  341. #undef poke
  342. #define       peek(a,b,c,d)   movedata(a,b,FP_SEG(c),FP_OFF(c),d)
  343. #define       poke(a,b,c,d)   movedata(FP_SEG(c),FP_OFF(c),a,b,d)
  344. #endif
  345.  
  346. #if    LATTICE & MSDOS
  347. /* you may have to remove this one definition with LATTICE version
  348.    3.2 and above                          */
  349. #define unsigned
  350. #endif
  351.  
  352. #if    IC
  353. #define inp    inportb
  354. #define outp    outportb
  355. #define intdos(a, b)    int86(33, a, b)
  356. #endif
  357.  
  358. #if    AZTEC
  359. #undef    putc
  360. #undef    getc
  361. #if    MSDOS
  362. #define getc    a1getc
  363. #define int86    sysint
  364. #define intdos(a, b)    sysint(33, a, b)
  365. #define inp    inportb
  366. #define outp    outportb
  367. #else
  368. #define getc    agetc
  369. #endif
  370. #define putc    aputc
  371.  
  372. struct XREG {
  373.     unsigned ax,bx,cx,dx,si,di,ds,es;
  374. };
  375.  
  376. struct HREG {
  377.     char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2;
  378. };
  379.  
  380. union REGS {
  381.     struct XREG x;
  382.     struct HREG h;
  383. };
  384.  
  385. struct SREGS {
  386.     unsigned cs, ss, ds, es;
  387. };
  388. #endif
  389.  
  390. #if    MSDOS & DTL
  391. #include    <dos.h>
  392. #endif
  393.  
  394. #if    MSDOS & MWC
  395. #include    <dos.h>
  396. #define int86(a, b, c)    intcall(b, c, a)
  397. #define intdos(a, b)    intcall(a, b, DOSINT)
  398. #define inp(a)        in(a)
  399. #define outp(a, b)    out(a, b)
  400. #define movmem(a, b, c) memcpy(b, a, c)
  401.  
  402. struct XREG {
  403.     unsigned int ax,bx,cx,dx,si,di,ds,es,flags;
  404. };
  405.  
  406. struct HREG {
  407.     char al,ah,bl,bh,cl,ch,dl,dh;
  408.     unsigned int ds,es,flags;
  409. };
  410.  
  411. union REGS {
  412.     struct XREG x;
  413.     struct HREG h;
  414. };
  415. #endif
  416.  
  417. #if    MSDOS & MSC
  418. #include    <dos.h>
  419. #include    <memory.h>
  420. #define peek(a,b,c,d)    movedata(a,b,FP_SEG(c),FP_OFF(c),d)
  421. #define poke(a,b,c,d)    movedata(FP_SEG(c),FP_OFF(c),a,b,d)
  422. #define movmem(a, b, c)     memcpy(b, a, c)
  423. #endif
  424.  
  425. #if    MSDOS & LATTICE
  426. #undef    CPM
  427. #undef    LATTICE
  428. #include    <dos.h>
  429. #undef    CPM
  430. #endif
  431.  
  432. /* System V doesn't name this the same as others */
  433. #if    USG | AUX | SUN | (OS2 & MSC)
  434. #define movmem(a, b, c)     memcpy(b, a, c)
  435. #endif
  436.  
  437. /* this keeps VMS happy */
  438. #if    VMS
  439. #define getname xgetname
  440. #define unlink(a)    delete(a)
  441. #endif
  442.  
  443. /* some options for AOS/VS */
  444. #if    AOSVS
  445. #define ORMDNI    1
  446. #endif
  447.  
  448. /*    define some ability flags */
  449.  
  450. #if    (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32)
  451. #define MEMMAP    1
  452. #else
  453. #define MEMMAP    0
  454. #endif
  455.  
  456. #if    MSDOS | WINNT | OS2 | V7 | USG | AUX | SMOS | HPUX8 | HPUX9 | BSD | (TOS & MWC) | WMCS | SUN | MPE
  457. #define ENVFUNC 1
  458. #else
  459. #define ENVFUNC 0
  460. #endif
  461.  
  462. #if    AUX
  463. #define RETCHAR    '\n'
  464. #else
  465. #define RETCHAR '\r'
  466. #endif
  467.  
  468. #if    MPE
  469. #define DIRSEPSTR    "."
  470. #define DIRSEPCHAR    '.'
  471. #else
  472. #if    TOS || MSDOS || WINNT || OS2
  473. #define DIRSEPSTR    "\\"
  474. #define DIRSEPCHAR    '\\'
  475. #else
  476. #define DIRSEPSTR    "/"
  477. #define DIRSEPCHAR    '/'
  478. #endif
  479. #endif
  480.  
  481. #define DRIVESEPCHAR    ':'
  482.  
  483. #if    VARARG
  484. #if    (GCC == 0) && (USG || AUX || BSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE)
  485. #define VARG    1
  486. #define SARG    0
  487. #include    <varargs.h>
  488. #else
  489. #define VARG    0
  490. #define SARG    1
  491. #include    <stdarg.h>
  492. #endif
  493. #endif
  494.  
  495. #if ZTC
  496. #include     <dos.h>
  497. #define      movmem(a, b, c) memcpy(b, a, c)
  498. #endif
  499.  
  500. /*    Emacs global flag bit definitions (for gflags)    */
  501.  
  502. #define GFREAD    1    /* read first file in at startup */
  503. #define GFSDRAW 2    /* suppress a screen redraw */
  504.  
  505. /*    internal constants    */
  506.  
  507. #define NBINDS    300            /* max # of bound keys        */
  508. #if    AOSVS | VMS | WINNT | SUN | BSD | V7 | ZENIX | OS2
  509. #define NFILEN    256
  510. #else
  511. #define NFILEN    80            /* # of bytes, file name    */
  512. #endif
  513. #define NBUFN    32            /* # of bytes, buffer name    */
  514. #define NLINE    256            /* # of bytes, input line    */
  515. #define NSTRING 128            /* # of bytes, string buffers    */
  516. #define NKBDM    256            /* # of strokes, keyboard macro */
  517. #define NPAT    128            /* # of bytes, pattern        */
  518. #define HUGE    1000            /* Huge number            */
  519. #define NLOCKS    256            /* max # of file locks active    */
  520. #define NCOLORS 16            /* number of supported colors    */
  521. #define KBLOCK    250            /* sizeof kill buffer chunks    */
  522. #define NRING    16            /* # of buffers in kill ring    */
  523. #define NBLOCK    16            /* line block chunk size    */
  524. #define NVSIZE    10            /* max #chars in a var name    */
  525. #define NMARKS    16            /* number of marks        */
  526.  
  527. #define CTRL    0x0100        /* Control flag, or'ed in        */
  528. #define META    0x0200        /* Meta flag, or'ed in            */
  529. #define CTLX    0x0400        /* ^X flag, or'ed in            */
  530. #define SPEC    0x0800        /* special key (function keys)        */
  531. #define MOUS    0x1000        /* alternative input device (mouse)    */
  532. #define SHFT    0x2000        /* shifted (for function keys)        */
  533. #define ALTD    0x4000        /* ALT key...                */
  534. #define MENU    MOUS+SPEC    /* menu selection (WINDOW_MSWIN)    */
  535.  
  536. #define BINDNUL 0        /* not bound to anything        */
  537. #define BINDFNC 1        /* key bound to a function        */
  538. #define BINDBUF 2        /* key bound to a buffer        */
  539.  
  540. #ifdef    FALSE
  541. #undef    FALSE
  542. #endif
  543. #ifdef    TRUE
  544. #undef    TRUE
  545. #endif
  546.  
  547. #define FALSE    0            /* False, no, bad, etc.     */
  548. #define TRUE    1            /* True, yes, good, etc.    */
  549. #define ABORT    2            /* Death, ^G, abort, etc.    */
  550. #define FAILED    3            /* not-quite fatal false return */
  551.  
  552. #define STOP    0            /* keyboard macro not in use    */
  553. #define PLAY    1            /*          playing    */
  554. #define RECORD    2            /*          recording    */
  555.  
  556. /*    Completion types     */
  557.  
  558. #define CMP_BUFFER    0
  559. #define CMP_COMMAND    1
  560. #define CMP_FILENAME    2
  561.  
  562. /*    Directive definitions    */
  563.  
  564. #define DIF        0
  565. #define DELSE        1
  566. #define DENDIF        2
  567. #define DGOTO        3
  568. #define DRETURN     4
  569. #define DENDM        5
  570. #define DWHILE        6
  571. #define DENDWHILE    7
  572. #define DBREAK        8
  573. #define DFORCE        9
  574.  
  575. #define NUMDIRS     10
  576.  
  577. /*
  578.  * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for
  579.  * routines that need directions.
  580.  */
  581. #define PTBEG    0    /* Leave the point at the beginning on search    */
  582. #define PTEND    1    /* Leave the point at the end on search     */
  583. #define FORWARD 0    /* do things in a forward direction        */
  584. #define REVERSE 1    /* do things in a backwards direction        */
  585.  
  586. #define FIOSUC    0            /* File I/O, success.        */
  587. #define FIOFNF    1            /* File I/O, file not found.    */
  588. #define FIOEOF    2            /* File I/O, end of file.    */
  589. #define FIOERR    3            /* File I/O, error.        */
  590. #define FIOMEM    4            /* File I/O, out of memory    */
  591. #define FIOFUN    5            /* File I/O, eod of file/bad line*/
  592. #define FIODEL    6            /* Can't delete/rename file    */
  593.  
  594. #if     WINDOW_MSWIN
  595. /* values for the fbusy flag */
  596. #define FREADING 1                      /* file read in progress */
  597. #define FWRITING 2                      /* file write in progress */
  598. /* if no file activity, the value FALSE is used */
  599. #endif
  600.  
  601. #define CFCPCN    0x0001            /* Last command was C-P, C-N    */
  602. #define CFKILL    0x0002            /* Last command was a kill    */
  603. #define CFSRCH    0x0004            /* last command was a search    */
  604. #define CFYANK    0x0008            /* last command was a yank    */
  605.  
  606. #define SRNORM    0            /* end past, begin front    */
  607. #define SRBEGIN 1            /* always at front        */
  608. #define SREND    2            /* always one past end        */
  609.  
  610. #define BELL    0x07            /* a bell character        */
  611. #define TAB    0x09            /* a tab character        */
  612.  
  613. #if    V7 | USG | AUX | SMOS | HPUX8 | HPUX9 | BSD | SUN | XENIX | AVIION
  614. #define PATHCHR ':'
  615. #else
  616. #if    WMCS || MPE
  617. #define PATHCHR ','
  618. #else
  619. #define PATHCHR ';'
  620. #endif
  621. #endif
  622.  
  623. #define INTWIDTH    sizeof(int) * 3
  624. #define LONGWIDTH    sizeof(long) * 3
  625.  
  626. /*    Macro argument token types                    */
  627.  
  628. #define TKNUL    0            /* end-of-string        */
  629. #define TKARG    1            /* interactive argument     */
  630. #define TKBUF    2            /* buffer argument        */
  631. #define TKVAR    3            /* user variables        */
  632. #define TKENV    4            /* environment variables    */
  633. #define TKFUN    5            /* function....         */
  634. #define TKDIR    6            /* directive            */
  635. #define TKLBL    7            /* line label            */
  636. #define TKLIT    8            /* numeric literal        */
  637. #define TKSTR    9            /* quoted string literal    */
  638. #define TKCMD    10            /* command name         */
  639.  
  640. /*    Internal defined functions                    */
  641.  
  642. #define nextab(a)    (a - (a % tabsize)) + tabsize
  643.  
  644. /* DIFCASE represents the integer difference between upper
  645.    and lower case letters.  It is an xor-able value, which is
  646.    fortunate, since the relative positions of upper to lower
  647.    case letters is the opposite of ascii in ebcdic.
  648. */
  649.  
  650. #if    ASCII
  651. #define DIFCASE     0x20
  652. #else
  653. #define DIFCASE     0x40
  654. #endif
  655.  
  656. /*    Dynamic RAM tracking and reporting redefinitions    */
  657.  
  658. #if    RAMSIZE
  659. #define malloc    allocate
  660. #define free    release
  661. #else
  662. #if    VMS & OPTMEM
  663. #define malloc    VAXC$MALLOC_OPT
  664. #define free    VAXC$FREE_OPT
  665. #define calloc    VAXC$CALLOC_OPT
  666. #define realloc    VAXC$REALLOC_OPT
  667. #define cfree    VAXC$CFREE_OPT
  668. #endif
  669. #endif
  670.  
  671. /* under MS Windows, we use dialog boxes to prompt the user for filenames */
  672. #if     WINDOW_MSWIN
  673. #define FILENAMEREPLY(p,b,nb)   filenamedlg(p,b,nb,TRUE)
  674. #else
  675. #define FILENAMEREPLY(p,b,nb)   mlreply(p,b,nb)
  676. #endif
  677.  
  678. /*
  679.  * There is a window structure allocated for every active display window. The
  680.  * windows are kept in a big list, in top to bottom screen order, with the
  681.  * listhead at "wheadp". Each window contains its own values of dot and mark.
  682.  * The flag field contains some bits that are set by commands to guide
  683.  * redisplay. Although this is a bit of a compromise in terms of decoupling,
  684.  * the full blown redisplay is just too expensive to run for every input
  685.  * character.
  686.  */
  687. typedef struct    WINDOW {
  688.     struct    WINDOW *w_wndp;     /* Next window            */
  689.     struct    BUFFER *w_bufp;     /* Buffer displayed in window    */
  690.     struct    LINE *w_linep;        /* Top line in the window    */
  691.     struct    LINE *w_dotp;        /* Line containing "."        */
  692.     short    w_doto;         /* Byte offset for "."        */
  693.     struct    LINE *w_markp[NMARKS];    /* Line containing "mark"    */
  694.     short    w_marko[NMARKS];    /* Byte offset for "mark"    */
  695.     char    w_toprow;        /* Origin 0 top row of window    */
  696.     char    w_ntrows;        /* # of rows of text in window    */
  697.     char    w_force;        /* If NZ, forcing row.        */
  698.     char    w_flag;         /* Flags.            */
  699. #if    COLOR
  700.     char    w_fcolor;        /* current forground color    */
  701.     char    w_bcolor;        /* current background color    */
  702. #endif
  703.     int    w_fcol;         /* first column displayed    */
  704. }    WINDOW;
  705.  
  706. #define WFFORCE 0x01            /* Window needs forced reframe    */
  707. #define WFMOVE    0x02            /* Movement from line to line    */
  708. #define WFEDIT    0x04            /* Editing within a line    */
  709. #define WFHARD    0x08            /* Better to a full display    */
  710. #define WFMODE    0x10            /* Update mode line.        */
  711. #define WFCOLR    0x20            /* Needs a color change     */
  712.  
  713. /* This structure holds the information about each line appearing on the
  714.  * video display. The redisplay module uses an array of virtual display
  715.  * lines. On systems that do not have direct access to display memory,
  716.  * there is also an array of physical display lines used to minimize
  717.  * video updating. In most cases, these two arrays are unique. If
  718.  * WINDOW_MSWIN is 1, there is a pair of such arrays in each SCREEN
  719.  * structure.
  720.  */
  721.  
  722. typedef struct    VIDEO {
  723.     int    v_flag;         /* Flags */
  724. #if    COLOR
  725.     int    v_fcolor;        /* current forground color */
  726.     int    v_bcolor;        /* current background color */
  727.     int    v_rfcolor;        /* requested forground color */
  728.     int    v_rbcolor;        /* requested background color */
  729. #endif
  730.     int    v_left;            /* left edge of reverse video */
  731.     int    v_right;        /* right right of reverse video */
  732. #if    INSDEL && MEMMAP == 0
  733.     int    v_rline;        /* requested screen line # */
  734. #endif
  735.     char    v_text[1];        /* Screen data. */
  736. }    VIDEO;
  737.  
  738. #define VFNEW    0x0001            /* contents not meaningful yet    */
  739. #define VFCHG    0x0002            /* Changed flag         */
  740. #define VFEXT    0x0004            /* extended (beyond column 80)    */
  741. #define VFCOL    0x0008            /* color change requested    */
  742.  
  743. /*
  744.  *    This structure holds the information about each separate "screen"
  745.  * within the current editing session.  On a character based system, these
  746.  * screens overlay each other, and can individually be brought to front.
  747.  * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh,
  748.  * Intuition, Sunview or X-windows, each screen is represented in an OS
  749.  * window.  The terminolgy is wrong in emacs.....
  750.  *
  751.  *    EMACS        The outside World
  752.  *    screen        window
  753.  *    window        pane
  754.  */
  755.  
  756. typedef struct SCREEN {
  757.     struct SCREEN *s_next_screen;    /* link to next screen in list */
  758.     WINDOW *s_first_window;     /* head of linked list of windows */
  759.     WINDOW *s_cur_window;        /* current window in this screen */
  760.     char *s_screen_name;        /* name of the current window */
  761.     short s_roworg;         /* row origin of stored screen */
  762.     short s_colorg;         /* column origin of stored screen */
  763.     short s_nrow;            /* row width of stored screen */
  764.     short s_ncol;            /* column origin of stored screen */
  765. #if WINDOW_MSWIN
  766.     VIDEO **s_virtual;        /* virtual screen contents */
  767.     VIDEO **s_physical;        /* physical screen contents */
  768.     HWND s_drvhandle;        /* handle for the "term" driver */
  769. #endif
  770. } SCREEN;
  771.  
  772. /*
  773.  * Text is kept in buffers. A buffer header, described below, exists for every
  774.  * buffer in the system. The buffers are kept in a big list, so that commands
  775.  * that search for a buffer by name can find the buffer header. There is a
  776.  * safe store for the dot and mark in the header, but this is only valid if
  777.  * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for
  778.  * the buffer is kept in a circularly linked list of lines, with a pointer to
  779.  * the header line in "b_linep".  Buffers may be "Inactive" which means the
  780.  * files associated with them have not been read in yet.  These get read in
  781.  * at "use buffer" time.
  782.  */
  783. typedef struct    BUFFER {
  784.     struct    BUFFER *b_bufp;     /* Link to next BUFFER        */
  785.     struct    LINE *b_dotp;        /* Link to "." LINE structure    */
  786.     short    b_doto;         /* Offset of "." in above LINE    */
  787.     struct    LINE *b_markp[NMARKS];    /* The same as the above two,    */
  788.     short    b_marko[NMARKS];    /* but for the "mark"        */
  789.     int    b_fcol;         /* first col to display     */
  790.     struct    LINE *b_linep;        /* Link to the header LINE    */
  791.     struct    LINE *b_topline;    /* Link to narrowed top text    */
  792.     struct    LINE *b_botline;    /* Link to narrowed bottom text */
  793.     char    b_active;        /* window activated flag    */
  794.     char    b_nwnd;         /* Count of windows on buffer    */
  795.     char    b_exec;         /* how many active executions    */
  796.     char    b_flag;         /* Flags            */
  797.     int    b_mode;         /* editor mode of this buffer    */
  798.     char    b_fname[NFILEN];    /* File name            */
  799.     char    b_bname[NBUFN];     /* Buffer name            */
  800. #if    CRYPT
  801.     char   b_key[NPAT];           /* current encrypted key        */
  802. #endif
  803. }    BUFFER;
  804.  
  805. #define BFINVS    0x01            /* Internal invisable buffer    */
  806. #define BFCHG    0x02            /* Changed since last write    */
  807. #define BFTRUNC 0x04            /* buffer was truncated when read */
  808. #define BFNAROW 0x08            /* buffer has been narrowed    */
  809.  
  810. /*    mode flags    */
  811. #define NUMMODES    10           /* # of defined modes           */
  812.  
  813. #define MDWRAP    0x0001            /* word wrap            */
  814. #define MDCMOD    0x0002            /* C indentation and fence match*/
  815. #define MDSPELL 0x0004            /* spell error parsing        */
  816. #define MDEXACT 0x0008            /* Exact matching for searches    */
  817. #define MDVIEW    0x0010            /* read-only buffer        */
  818. #define MDOVER    0x0020            /* overwrite mode        */
  819. #define MDMAGIC 0x0040            /* regular expresions in search */
  820. #define MDCRYPT 0x0080            /* encrytion mode active    */
  821. #define MDASAVE 0x0100            /* auto-save mode        */
  822. #define MDREPL    0x0200            /* replace mode         */
  823.  
  824. /*
  825.  * The starting position of a region, and the size of the region in
  826.  * characters, is kept in a region structure.  Used by the region commands.
  827.  */
  828. typedef struct    {
  829.     struct    LINE *r_linep;        /* Origin LINE address.     */
  830.     short    r_offset;        /* Origin LINE offset.        */
  831.     long    r_size;         /* Length in characters.    */
  832. }    REGION;
  833.  
  834. /*
  835.  * All text is kept in circularly linked lists of "LINE" structures. These
  836.  * begin at the header line (which is the blank line beyond the end of the
  837.  * buffer). This line is pointed to by the "BUFFER". Each line contains a the
  838.  * number of bytes in the line (the "used" size), the size of the text array,
  839.  * and the text. The end of line is not stored as a byte; it's implied.
  840.  */
  841. typedef struct    LINE {
  842.     struct    LINE *l_fp;        /* Link to the next line    */
  843.     struct    LINE *l_bp;        /* Link to the previous line    */
  844.     short    l_size;         /* Allocated size        */
  845.     short    l_used;         /* Used size            */
  846.     char    l_text[1];        /* A bunch of characters.    */
  847. }    LINE;
  848.  
  849. #define lforw(lp)    ((lp)->l_fp)
  850. #define lback(lp)    ((lp)->l_bp)
  851. #define lgetc(lp, n)    ((lp)->l_text[(n)])
  852. #define lputc(lp, n, c) ((lp)->l_text[(n)]=(c))
  853. #define lused(lp)    ((lp)->l_used)
  854. #define lsize(lp)    ((lp)->l_size)
  855. #define ltext(lp)    ((lp)->l_text)
  856.  
  857. /*
  858.  * The editor communicates with the display using a high level interface. A
  859.  * "TERM" structure holds useful variables, and indirect pointers to routines
  860.  * that do useful operations. The low level get and put routines are here too.
  861.  * This lets a terminal, in addition to having non standard commands, have
  862.  * funny get and put character code too. The calls might get changed to
  863.  * "termp->t_field" style in the future, to make it possible to run more than
  864.  * one terminal type.
  865.  */
  866. #if    PROTO
  867. typedef struct    {
  868.     short    t_mrow;         /* max number of rows allowable */
  869.     short    t_nrow;         /* current number of rows used    */
  870.     short    t_mcol;         /* max Number of columns.    */
  871.     short    t_ncol;         /* current Number of columns.    */
  872.     short    t_roworg;        /* origin row (normally zero)    */
  873.     short    t_colorg;        /* origin column (normally zero)*/
  874.     short    t_margin;        /* min margin for extended lines*/
  875.     short    t_scrsiz;        /* size of scroll region "    */
  876.     int    t_pause;        /* # times thru update to pause */
  877.     int (PASCAL NEAR *t_open)(void);    /* Open terminal at the start.*/
  878.     int (PASCAL NEAR *t_close)(void);   /* Close terminal at end.    */
  879.     int (PASCAL NEAR *t_kopen)(void);   /* Open keyboard        */
  880.     int (PASCAL NEAR *t_kclose)(void);  /* Close keyboard        */
  881.     int (PASCAL NEAR *t_getchar)(void); /* Get character from keyboard. */
  882.     int (PASCAL NEAR *t_putchar)(int);  /* Put character to display.*/
  883.     int (PASCAL NEAR *t_flush)(void);   /* Flush output buffers.    */
  884.     int (PASCAL NEAR *t_move)(int, int);/* Move the cursor, origin 0.*/
  885.     int (PASCAL NEAR *t_eeol)(void);    /* Erase to end of line.    */
  886.     int (PASCAL NEAR *t_eeop)(void);    /* Erase to end of page.    */
  887.     int (PASCAL NEAR *t_clrdesk)(void); /* Clear the page totally    */
  888.     int (PASCAL NEAR *t_beep)(void);    /* Beep.            */
  889.     int (PASCAL NEAR *t_rev)(int);      /* set reverse video state    */
  890.     int (PASCAL NEAR *t_rez)(char *);   /* change screen resolution    */
  891. #if    COLOR
  892.     int (PASCAL NEAR *t_setfor)(int);   /* set forground color    */
  893.     int (PASCAL NEAR *t_setback)(int);  /* set background color     */
  894. #endif
  895. #if    INSDEL
  896.     int (PASCAL NEAR *t_insline)(int); /* insert a screen line     */
  897.     int (PASCAL NEAR *t_delline)(int); /* delete a screen line     */
  898. #endif
  899. #if     WINDOW_MSWIN
  900.         int (PASCAL NEAR *t_sleep)(int);   /* go to sleep for a while    */
  901.         int (PASCAL NEAR *t_newscr)(SCREEN *);  /* create new screen display */
  902.         int (PASCAL NEAR *t_delscr)(SCREEN *);  /* destroy screen display */
  903.         int (PASCAL NEAR *t_selscr)(SCREEN *);  /* select screen display */
  904.         int (PASCAL NEAR *t_sizscr)(SCREEN *);  /* resize screen display */
  905.         int (PASCAL NEAR *t_topscr)(SCREEN *);  /* bring screen to top    */
  906. #endif
  907. }    TERM;
  908. #else    /* TERM structure, no prototyping.*/
  909.  
  910. typedef struct    {
  911.     short    t_mrow;         /* max number of rows allowable */
  912.     short    t_nrow;         /* current number of rows used    */
  913.     short    t_mcol;         /* max Number of columns.    */
  914.     short    t_ncol;         /* current Number of columns.    */
  915.     short    t_roworg;        /* origin row (normally zero)    */
  916.     short    t_colorg;        /* origin column (normally zero)*/
  917.     short    t_margin;        /* min margin for extended lines*/
  918.     short    t_scrsiz;        /* size of scroll region "    */
  919.     int    t_pause;        /* # times thru update to pause */
  920.     int (PASCAL NEAR *t_open)();    /* Open terminal at the start.    */
  921.     int (PASCAL NEAR *t_close)();    /* Close terminal at end.    */
  922.     int (PASCAL NEAR *t_kopen)();    /* Open keyboard        */
  923.     int (PASCAL NEAR *t_kclose)();    /* close keyboard        */
  924.     int (PASCAL NEAR *t_getchar)(); /* Get character from keyboard. */
  925.     int (PASCAL NEAR *t_putchar)(); /* Put character to display.    */
  926.     int (PASCAL NEAR *t_flush)();    /* Flush output buffers.    */
  927.     int (PASCAL NEAR *t_move)();    /* Move the cursor, origin 0.    */
  928.     int (PASCAL NEAR *t_eeol)();    /* Erase to end of line.    */
  929.     int (PASCAL NEAR *t_eeop)();    /* Erase to end of page.    */
  930.     int (PASCAL NEAR *t_clrdesk)(); /* Clear the page totally    */
  931.     int (PASCAL NEAR *t_beep)();    /* Beep.            */
  932.     int (PASCAL NEAR *t_rev)();    /* set reverse video state    */
  933.     int (PASCAL NEAR *t_rez)();    /* change screen resolution    */
  934. #if    COLOR
  935.     int (PASCAL NEAR *t_setfor)();    /* set forground color        */
  936.     int (PASCAL NEAR *t_setback)(); /* set background color     */
  937. #endif
  938. #if    INSDEL
  939.     int (PASCAL NEAR *t_insline)(); /* insert a screen line     */
  940.     int (PASCAL NEAR *t_delline)(); /* delete a screen line     */
  941. #endif
  942. #if     WINDOW_MSWIN
  943.         int (PASCAL NEAR *t_sleep)();   /* go to sleep for a while    */
  944.         int (PASCAL NEAR *t_newscr)();  /* create new screen display    */
  945.         int (PASCAL NEAR *t_delscr)();  /* destroy screen display    */
  946.         int (PASCAL NEAR *t_selscr)();  /* select screen display    */
  947.         int (PASCAL NEAR *t_sizscr)();  /* resize screen display    */
  948.         int (PASCAL NEAR *t_topscr)();  /* bring screen to top        */
  949. #endif
  950. }    TERM;
  951. #endif
  952.  
  953.  
  954. /*    TEMPORARY macros for terminal I/O  (to be placed in a machine
  955.                         dependant place later) */
  956.  
  957. #define TTopen        (*term.t_open)
  958. #define TTclose     (*term.t_close)
  959. #define TTkopen     (*term.t_kopen)
  960. #define TTkclose    (*term.t_kclose)
  961. #define TTgetc        (*term.t_getchar)
  962. #define TTputc        (*term.t_putchar)
  963. #define TTflush     (*term.t_flush)
  964. #define TTmove        (*term.t_move)
  965. #define TTeeol        (*term.t_eeol)
  966. #define TTeeop        (*term.t_eeop)
  967. #define TTclrdesk    (*term.t_clrdesk)
  968. #define TTbeep        (*term.t_beep)
  969. #define TTrev        (*term.t_rev)
  970. #define TTrez        (*term.t_rez)
  971. #if    COLOR
  972. #define TTforg        (*term.t_setfor)
  973. #define TTbacg        (*term.t_setback)
  974. #endif
  975.  
  976. /*    Structure for the table of current key bindings     */
  977.  
  978. ETYPE EPOINTER {
  979.     int (PASCAL NEAR *fp)();    /* C routine to invoke */
  980.     BUFFER *buf;            /* buffer to execute */
  981. };
  982.  
  983. typedef struct    {
  984.     short k_code;        /* Key code            */
  985.     short k_type;        /* binding type (C function or EMACS buffer) */
  986.     ETYPE EPOINTER k_ptr;    /* ptr to thing to execute */
  987. }    KEYTAB;
  988.  
  989. /*    structure for the name binding table        */
  990.  
  991. typedef struct {
  992.     char *n_name;            /* name of function key */
  993.     int (PASCAL NEAR *n_func)();    /* function name is bound to */
  994. }    NBIND;
  995.  
  996. /*    The editor holds deleted text chunks in the KILL buffer. The
  997.     kill buffer is logically a stream of ascii characters, however
  998.     due to its unpredicatable size, it gets implemented as a linked
  999.     list of chunks. (The d_ prefix is for "deleted" text, as k_
  1000.     was taken up by the keycode structure)
  1001. */
  1002.  
  1003. typedef struct KILL {
  1004.     struct KILL *d_next;   /* link to next chunk, NULL if last */
  1005.     char d_chunk[KBLOCK];    /* deleted text */
  1006. } KILL;
  1007.  
  1008. /*    When emacs's command interpetor needs to get a variable's name,
  1009.     rather than it's value, it is passed back as a VDESC variable
  1010.     description structure. The v_num field is a index into the
  1011.     appropriate variable table.
  1012. */
  1013.  
  1014. typedef struct VDESC {
  1015.     int v_type;    /* type of variable */
  1016.     int v_num;    /* ordinal pointer to variable in list */
  1017. } VDESC;
  1018.  
  1019. /*    The !WHILE directive in the execution language needs to
  1020.     stack references to pending whiles. These are stored linked
  1021.     to each currently open procedure via a linked list of
  1022.     the following structure
  1023. */
  1024.  
  1025. typedef struct WHBLOCK {
  1026.     LINE *w_begin;        /* ptr to !while statement */
  1027.     LINE *w_end;        /* ptr to the !endwhile statement*/
  1028.     int w_type;        /* block type */
  1029.     struct WHBLOCK *w_next; /* next while */
  1030. } WHBLOCK;
  1031.  
  1032. #define BTWHILE     1
  1033. #define BTBREAK     2
  1034.  
  1035.  
  1036. /* HICHAR - 1 is the largest character we will deal with.
  1037.  * BMAPSIZE represents the number of bytes in the bitmap.
  1038.  */
  1039. #define HICHAR        256
  1040. #define BMAPSIZE    HICHAR >> 3
  1041.  
  1042. #if    MAGIC
  1043. /*
  1044.  * Defines for the metacharacters in the regular expression
  1045.  * search routines.  MCNIL and GROUP are used in both search
  1046.  * and replace metachar-arrays.
  1047.  */
  1048. #define MCNIL        0    /* Like the '\0' for strings.*/
  1049. #define LITSTRING    1    /* Literal string.*/
  1050. #define LITCHAR     2    /* Literal character.*/
  1051. #define ANY        3    /* Any character but the <NL>.*/
  1052. #define CCL        4
  1053. #define NCCL        5
  1054. #define BOL        6
  1055. #define EOL        7
  1056. #define GRPBEG        8    /* Signal start of group.*/
  1057. #define GRPEND        9    /* Signal end of group.*/
  1058. #define GROUP        10    /* String of group match.*/
  1059. #define DITTO        11    /* Replacement with match string.*/
  1060.  
  1061. #define CLOSURE     0x0100    /* An or-able value for a closure modifier.*/
  1062. #define CLOSURE_1    0x0200    /* An or-able value for a closure modifier.*/
  1063. #define ZEROONE     0x0400    /* An or-able value for a closure modifier.*/
  1064.  
  1065. #define ALLCLOS     (CLOSURE | CLOSURE_1 | ZEROONE)
  1066. #define MASKCLO     (~ALLCLOS)
  1067.  
  1068. #define MC_ANY        '.'    /* 'Any' character (except newline).*/
  1069. #define MC_CCL        '['    /* Character class.*/
  1070. #define MC_NCCL     '^'    /* Negate character class.*/
  1071. #define MC_RCCL     '-'    /* Range in character class.*/
  1072. #define MC_ECCL     ']'    /* End of character class.*/
  1073. #define MC_BOL        '^'    /* Beginning of line.*/
  1074. #define MC_EOL        '$'    /* End of line.*/
  1075. #define MC_CLOSURE    '*'    /* Closure - zero to many characters match.*/
  1076. #define MC_CLOSURE_1    '+'    /* Closure - one to many characters match.*/
  1077. #define MC_ZEROONE    '?'    /* Closure - zero to one characters match.*/
  1078. #define MC_DITTO    '&'    /* Use matched string in replacement.*/
  1079. #define MC_GRPBEG    '('    /* Start of group (begun with a backslash).*/
  1080. #define MC_GRPEND    ')'    /* End of group (begun with a backslash).*/
  1081. #define MC_ESC        '\\'    /* Escape - suppress meta-meaning.*/
  1082.  
  1083. #define MAXGROUPS    10        /* 1 + maximum # of r. e. groups. */
  1084. #define BIT(n)        (1 << (n))    /* An integer with one bit set.*/
  1085.  
  1086. /* Typedefs that define the bitmap type for searching (EBITMAP),
  1087.  * the meta-character structure for MAGIC mode searching (MC),
  1088.  * and the meta-character structure for MAGIC mode replacment (RMC).
  1089.  */
  1090. typedef char    *EBITMAP;
  1091.  
  1092. typedef struct {
  1093.     short int    mc_type;
  1094.     union {
  1095.         int    lchar;
  1096.         int    group_no;
  1097.         EBITMAP    cclmap;
  1098.     } u;
  1099. } MC;
  1100.  
  1101. typedef struct {
  1102.     short int    mc_type;
  1103.     union {
  1104.         int    group_no;
  1105.         char    *rstr;
  1106.     } u;
  1107. } RMC;
  1108. #endif
  1109.  
  1110. /*
  1111.     This is the message which should be added to any "About MicroEMACS"
  1112.     boxes on any of the machines with window managers.
  1113.  
  1114.  
  1115.     ------------------------------------------
  1116.     |                     |
  1117.     |     MicroEMACS v3.xx         |
  1118.     |        for the ............     |
  1119.     |                     |
  1120.     |    Text Editor and Corrector         |
  1121.     |                     |
  1122.     |    written by Daniel M. Lawrence     |
  1123.     |    [based on code by Dave Conroy]     |
  1124.     |                     |
  1125.     |    Send inquiries and donations to:     |
  1126.     |    617 New York St             |
  1127.     |    Lafayette, IN 47901         |
  1128.     |                     |
  1129.     ------------------------------------------
  1130. */
  1131.